package com.nuanshui.heatedloan.order.integration.execute;


import com.nuanshui.heatedloan.dubbo.DubboResponse;
import com.nuanshui.heatedloan.order.integration.form.OrderExecuteForm;
import org.springframework.data.domain.Pageable;

import java.util.Map;

/**
 * 订单对外提供的方法，所有订单的操作都提供接口对外面
 * @Author: Gonzo
 * @Date 2017/3/1714:19
 * @since 1.4.2
 */
public interface OrderExecuteFacade {
	
	/**
	 * 生成订单
	 * @Author: Gonzo
	 * @Date 2017/3/1714:20
	 * @since 1.4.2
	 */
	DubboResponse executePlaceOrder(OrderExecuteForm form);


	/**
	 * 获取订单列表
	 * @Author: Gonzo
	 * @Date 2017/3/1714:20
	 * @param  orderType  订单的类型 @see com.nuanshui.heatedloan.appointment.constant.AppointmentOrderTypeConstant
	 * @param  orderListType
	 * @param  userId
	 * @param  pager
	 * @since 1.4.2
	 */
	Map<String, Object> listAppointmentOrder(Integer orderType, Integer orderListType, String userId, Pageable pager);

	/**
	 * 获取订单详情
	 * @Author: Gonzo
	 * @Date 2017/3/1714:20
	 * @since 1.4.2
	 */
	Map<String, Object> getAppointmentOrderDetail(String orderNum, String userId);

	/**
	 * 取消订单
	 * @param orderNum
	 * @param cancleReason
	 * @param userId
	 */
	void cancelAppointmentOrder(String orderNum, String cancleReason , String userId);

	/**
	 * 预约订单, 到时间但是未入场, 置为失效
	 * @Author: Gonzo
	 * @Date 2017/4/12下午7:53
	 * @since 1.4.2
	 */
	DubboResponse expireOrder(String orderNum);

	/**
	 * 订单超时未支付, 置为失效
	 * @Author: Gonzo
	 * @Date 2017/4/13上午9:52
	 * @since 1.4.2
	 */
	DubboResponse overtimeOrder(String orderNum);
	
	/**
	 * 订单支付成功的回调, 将订单置为成功状态
	 * @Author: Gonzo
	 * @Date 2017/4/14上午11:31
	 * @since 1.4.2
	 */
	DubboResponse paySuccess(String orderNum);
}
